//
//  NoDataView.m
//  DailyRecord
//
//  Created by Gin on 2022/3/29.
//

#import "NoDataView.h"

@interface NoDataView()

@property (nonatomic, strong) UIImageView *imgView;

@property (nonatomic, strong) UILabel *infoLb;

@end

@implementation NoDataView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
    }
    return self;
}

- (void)initUI{
    [self addSubview:self.infoLb];
    [self addSubview:self.imgView];
}

- (void)setUpContraints{
    [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self);
        make.size.mas_equalTo(CGSizeMake(60, 60));
    }];
    
    [self.infoLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self.imgView.mas_bottom).offset(kBottomSpace);
    }];
}

#pragma mark -- setter&&getter

- (UILabel *)infoLb{
    if (!_infoLb) {
        _infoLb = [UILabel new];
        _infoLb.font = kDescFont;
        _infoLb.text = @"暂无数据";
    }
    return _infoLb;
}

- (UIImageView *)imgView{
    if (!_imgView) {
        _imgView = [UIImageView new];
        _imgView.image = [UIImage imageNamed:@"zanwushuju"];
    }
    return _imgView;
}

@end
